package com.atguigu.tingshu.order.strategy;

import com.atguigu.tingshu.vo.order.OrderDerateVo;
import com.atguigu.tingshu.vo.order.OrderDetailVo;
import com.atguigu.tingshu.vo.order.OrderInfoVo;
import com.atguigu.tingshu.vo.order.TradeVo;
import org.jetbrains.annotations.NotNull;

import java.math.BigDecimal;
import java.util.List;

/**
 * Package: com.atguigu.tingshu.order.strategy
 *
 * @author xiongkunYang
 * @description: 策略接口。订单结算页面数据处理
 * @since 2025/6/26 11:04
 */

public interface TradeStrategy {
    OrderInfoVo processTrade(Long userId, TradeVo tradeVo);

    default void setParam(@NotNull OrderInfoVo orderInfoVo,
                          BigDecimal originalAmount, BigDecimal orderAmount, BigDecimal derateAmount,
                          List<OrderDetailVo> orderDetailVoList, List<OrderDerateVo> orderDerateVoList) {
        orderInfoVo.setOriginalAmount(originalAmount);
        orderInfoVo.setOrderAmount(orderAmount);
        orderInfoVo.setDerateAmount(derateAmount);
        orderInfoVo.setOrderDetailVoList(orderDetailVoList);
        orderInfoVo.setOrderDerateVoList(orderDerateVoList);
    }
}
